package com.lxyblog2030.blog.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 指定拦截内容的配置类 加载自定义的拦截器
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/admin/**")
               /* .excludePathPatterns("/admin","/admin/login");*/
               .excludePathPatterns("/admin","/admin/login","/css/**","/image/**","/js/**","/lib/**");


    }
}
